From: Eli Zaretskii Date: Sat, 21 Sep 2013 11:48:19 +0000 (+0300) Subject: Fix bug #15426 with directory-files invoked from a unibyte buffer. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~3077 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=b3f1d1198a0dddc02423f0f766e9e213373fab60;p=emacs.git Fix bug #15426 with directory-files invoked from a unibyte buffer. src/dired.c (directory_files_internal): Use multibyte_chars_in_text, not chars_in_text, whose result depends on the multibyteness of the current buffer. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7b59b33c8bd..37e04f03c85 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-09-21 Eli Zaretskii + + * dired.c (directory_files_internal): Use multibyte_chars_in_text, + not chars_in_text, whose result depends on the multibyteness of + the current buffer. (Bug#15426) + 2013-09-20 Paul Eggert Port recent change to hosts where pointers aren't 'long'. diff --git a/src/dired.c b/src/dired.c index 2b79b54f2a4..1bdb171c4d0 100644 --- a/src/dired.c +++ b/src/dired.c @@ -278,7 +278,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, memcpy (SDATA (fullname) + directory_nbytes + needsep, SDATA (name), len); - nchars = chars_in_text (SDATA (fullname), nbytes); + nchars = multibyte_chars_in_text (SDATA (fullname), nbytes); /* Some bug somewhere. */ if (nchars > nbytes)